<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Connection</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">

<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#author">AUTHOR</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<pre>
    SQLRelay::Connection - Perl API for SQL Relay</pre>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
        use SQLRelay::Connection;
        use SQLRelay::Cursor;</pre>
<pre>
        my $sc=SQLRelay::Connection-&gt;new(&quot;testhost&quot;,9000,&quot;&quot;,
                                          &quot;testuser&quot;,&quot;testpassword&quot;,0,1);
        my $ss=SQLRelay::Cursor-&gt;new($sc);</pre>
<pre>
        $ss-&gt;sendQuery(&quot;select table_name from user_tables&quot;);
        $sc-&gt;endSession();</pre>
<pre>
        for (my $i=0; $i&lt;$ss-&gt;rowCount(); $i++) {
                print $ss-&gt;getField($i,&quot;table_name&quot;), &quot;\n&quot;;
        }</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<pre>
    SQLRelay::Connection</pre>
<pre>
        new(server, port, socket, user, password, retrytime, tries);
            # Initiates a connection to &quot;server&quot; on &quot;port&quot;
            # or to the unix &quot;socket&quot; on the local machine
            # and authenticates with &quot;user&quot; and &quot;password&quot;.
            # Failed connections will be retried for 
            # &quot;tries&quot; times on interval &quot;retrytime&quot;.
            # If &quot;tries&quot; is 0 then retries will continue
            # forever.  If &quot;retrytime&quot; is 0 then retries
            # will be attempted on a default interval.
            #
            # If the &quot;socket&quot; parameter is neither
            # NULL nor &quot;&quot; then an attempt will be made to
            # connect through it before attempting to
            # connect to &quot;server&quot; on &quot;port&quot;.  If it is
            # NULL or &quot;&quot; then no attempt will be made to
            # connect through the socket.</pre>
<pre>
        DESTROY();
            # Disconnects and ends the session if
            # it hasn't been ended already.</pre>
<pre>
        endSession();
            # Ends the session.</pre>
<pre>
        suspendSession();
            # Leaves the session open so another client
            # can connect to it.
            
        getConnectionPort();
            # Returns the inet port that the client is 
            # communicating over. This parameter may be 
            # passed to another client for use in
            # the resumeSession() command below.
            # Note: the value returned by this method is
            # only valid after a call to suspendSession().</pre>
<pre>
        getConnectionSocket();
            # Returns the unix socket that the client is 
            # communicating over. This parameter may be 
            # passed to another client for use in
            # the resumeSession() command below.
            # Note: the value returned by this method is
            # only valid after a call to suspendSession().</pre>
<pre>
        resumeSession(port,socket);
            # Resumes a session previously left open 
            # using suspendSession().
            # Returns true on success and false on failure.</pre>
<pre>
        ping();
            # Returns true if the database is up and false
            # if it's down.</pre>
<pre>
        identify();
            # Returns the type of database:
            #   oracle8, postgresql, mysql, etc.</pre>
<pre>
        dbVersion();
            # Returns the version of the database</pre>
<pre>
        serverVersion();
            # Returns the version of the SQL Relay server software</pre>
<pre>
        clientVersion();
            # Returns the version of the SQL Relay client software</pre>
<pre>
        bindFormat();
            # Returns a string representing the format
            # of the bind variables used in the db.</pre>
<pre>
        autoCommitOn();
            # Instructs the database to perform a commit
            # after every successful query.
            # Returns true if setting autocommit on succeeded
            # and false if it failed.</pre>
<pre>
        autoCommitOff();
            # Instructs the database to wait for the 
            # client to tell it when to commit.
            # Returns true if setting autocommit off succeeded
            # and false if it failed.</pre>
<pre>
        commit();
            # Issues a commit.  Returns true if the commit
            # succeeded, false if it failed.</pre>
<pre>
        rollback();
            # Issues a rollback.  Returns true if the rollback
            # succeeded, false if it failed.</pre>
<pre>
        debugOn();
            # Causes verbose debugging information to be 
            # sent to standard output.  Another way to do 
            # this is to start a query with &quot;-- debug\n&quot;.</pre>
<pre>
        debugOff();
            # Turns debugging off.</pre>
<pre>
        getDebug();
            # Returns true if debugging is currently on and false
            # if debugging is currently off.</pre>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<pre>
    David Muse
    david.muse@firstworks.com</pre>

</body>

</html>
